<template>
  <z-modal
    v-bind="modalOption"
    @ok="handleOk"
    @cancel="handleCancel"
    cancelText="关闭"
  >
    <a-spin :spinning="confirmLoading">
      <a-form-model layout="horizontal" labelAlign="right" ref="ruleForm" :label-col="labelCol" :wrapper-col="wrapperCol" :model="form" :rules="validatorRules">
        <a-row>
          <a-col :span="12" >
            <a-form-model-item label="用户" prop = "userName" >
              <a-input v-model.trim="form.userName" :disabled="disableSubmit"/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12" >
            <a-form-model-item label="姓名" prop = "nickName" >
              <a-input v-model.trim="form.nickName" disabled/>
            </a-form-model-item>
          </a-col>
          <a-col :span="12" >
            <a-form-model-item label="租户" prop="tenantId">
              <z-dict-select-tag v-model="form.tenantId" :disabled="disableSubmit" dictCode="BEISEN_ACTIVITY_TENANT"/>
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>
    </a-spin>
  </z-modal>
</template>

<script>
import ModalFormMixin from '@/mixins/ModalFormMixin'
import ZDictSelectTag from '@/components/dict/ZDictSelectTag'
export default {
  name: 'TenantUserModal',
  components: { ZDictSelectTag },
  mixins: [ModalFormMixin],
  data() {
    return {
      validatorRules: {
        userName: [{ required: true, message: '请输入用户' }],
        tenantId: [{ required: true, message: '请选择租户' }]
      },
      url: {
        add: '/assessment/tenantuser/v1/add',
        edit: '/assessment/tenantuser/v1/edit'
      }
    }
  }
}
</script>

